﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" xmlns:grid="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView">
    <telerik:VistaTheme x:Key="Theme" />
    <LinearGradientBrush x:Key="GridView_ScrollViewerIntersectionRectangleBackground" EndPoint="1,1" StartPoint="0,0">
        <GradientStop Color="#FFFAFAFA" Offset="0.345"/>
        <GradientStop Color="#FFDAE1E4" Offset="0.035"/>
        <GradientStop Color="#FF84ADC5" Offset="0.034"/>
    </LinearGradientBrush>

    <ControlTemplate x:Key="GridViewScrollViewerTemplate" TargetType="grid:GridViewScrollViewer">
        <Grid Name="PART_RootPanel" Background="{TemplateBinding Background}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <grid:ScrollContentPresenter Name="PART_ScrollContentPresenter"
            
            
                Grid.Row="2" CanContentScroll="{TemplateBinding CanContentScroll}" />

            <ScrollBar x:Name="PART_VerticalScrollBar"
					   BorderThickness="1,0,0,0"
                       IsTabStop="False"
                       Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
                       Grid.Column="1" Grid.Row="0" Grid.RowSpan="4" Orientation="Vertical" 
					   ViewportSize="{TemplateBinding ViewportHeight}"
                       Maximum="{TemplateBinding ScrollableHeight}"
                       Minimum="0.0"
                       Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"/>

            <ScrollBar x:Name="PART_HorizontalScrollBar" 
					   BorderThickness="0,1,0,0"
                       IsTabStop="False" 
                       Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
                       Grid.Column="0" Grid.Row="4" Orientation="Horizontal"
					   ViewportSize="{TemplateBinding ViewportWidth}"
                       Maximum="{TemplateBinding ScrollableWidth}"
                       Minimum="0.0"
                       Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}"/>
            <Rectangle Grid.Column="1" Grid.Row="4" Fill="{StaticResource GridView_ScrollViewerIntersectionRectangleBackground}" />
        </Grid>
    </ControlTemplate>

    <Style 
        
		TargetType="grid:GridViewScrollViewer">

        <Setter Property="Template" Value="{StaticResource GridViewScrollViewerTemplate}" />
    </Style>
</ResourceDictionary>
